package vip.xiaonuo.smzq.modular.psba.controller;

import javax.annotation.Resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import vip.xiaonuo.smzq.modular.psba.entity.PsbaSqjlYfjbqk;
import vip.xiaonuo.smzq.modular.psba.entity.vo.PsbaSqjlYfjbqkVo;
import vip.xiaonuo.smzq.modular.psba.entity.vo.PsbaYfxqVo;
import vip.xiaonuo.smzq.modular.psba.service.IPsbaSqjlYfjbqkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.common.pojo.CommonResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * 评审备案申请记录-压覆基本情况
 *
 * @author Kevin
 * @since 2024-06-11
 */
@Api(tags = "评审备案申请记录-压覆基本情况")
@RestController
@RequestMapping("/psba/psbaSqjlYfjbqk")
@Validated
public class PsbaSqjlYfjbqkController {

    @Resource
    private IPsbaSqjlYfjbqkService iPsbaSqjlYfjbqkService;

    /**
     * 添加评审备案申请记录-压覆基本情况
     */
    @ApiOperation("添加评审备案申请记录-压覆基本情况")
    @PostMapping("/add")
    public CommonResult<String> add(@RequestBody @Valid PsbaSqjlYfjbqk psbaSqjlYfjbqk) {
        iPsbaSqjlYfjbqkService.save(psbaSqjlYfjbqk);
        return CommonResult.ok();
    }

    /**
     * 删除评审备案申请记录-压覆基本情况
     */
    @ApiOperation("删除评审备案申请记录-压覆基本情况")
    @PostMapping("/delete")
    public CommonResult<String> delete(@ApiParam(name = "pkid", value = "主键") @RequestParam String pkid) {
        iPsbaSqjlYfjbqkService.removeById(pkid);
        return CommonResult.ok();
    }

    /**
     * 编辑评审备案申请记录-压覆基本情况
     */
    @ApiOperation("编辑评审备案申请记录-压覆基本情况")
    @PostMapping("/edit")
    public CommonResult<String> edit(@RequestBody @Valid PsbaSqjlYfjbqk psbaSqjlYfjbqk) {
        iPsbaSqjlYfjbqkService.updateById(psbaSqjlYfjbqk);
        return CommonResult.ok();
    }

    /**
     * 评审备案申请记录-压覆基本情况分页查询
     */
    @ApiOperation("评审备案申请记录-压覆基本情况分页查询")
    @GetMapping("/list")
    public CommonResult<Page<PsbaSqjlYfjbqk>> page() {
        return CommonResult.data(iPsbaSqjlYfjbqkService.page(new PsbaSqjlYfjbqk()));
    }
    /**
     * 评审备案申请记录-评审备案申请-压覆基本情况
     */
    @ApiOperation("评审备案申请记录-评审备案申请-压覆基本情况")
    @GetMapping("/getPsbaSqjlYfjbqk")
    public CommonResult<PsbaSqjlYfjbqkVo> getPsbaSqjlYfjbqk(@ApiParam(name = "psbabh", value = "评审备案编号") @RequestParam String psbabh) {
        return CommonResult.data(iPsbaSqjlYfjbqkService.getPsbaSqjlYfjbqk(psbabh));
    }
}
